#ifndef RECORDER_H  
#define RECORDER_H  
#include<string>
#include<iostream>
#include<mutex>
#include<cstdio>
#include<fstream>
#include <fcntl.h>
#include <unistd.h>
#include <sys/file.h>
#include<vector>
#include <semaphore.h>
#include <sys/stat.h>
#include<functional>

class Recorder{
public:
    std::string path;
    std::string slice1 ="key:\"" ,slice2 = "\" Value:\"",slice3 = "\" [{KEY:\"",slice4 = "\" Value:\"",slice5 = "\",key:\"";
    std::string slice6 = "\" value:\"",slice7 =  "\",KEY:\"",slice8 =  "\",Value:\"",slice9 = "\" ,KEY:CPU Value:\"",slice10 = "\",KEY:\"MEM\" Value:\"",slice11 = "\"},]";
    std::vector<int> pids;
    Recorder(std::string path);
    ~Recorder();

   void sem_a_up(int pid);
   void sem_a_down(int pid);
   void sem_b_up(int pid);
   void sem_b_down(int pid);

    void lock(int pid);
    void unlock(int pid);

    void teset1(int pid);
    void teset2(int pid);

};

#endif
